// main.js
import Vue from 'vue';
import VueRouter from 'vue-router';


Vue.use(VueRouter);
export const routes=[
    // { path: '/',redirect:'/JobOrderStatistics',meta:{title:'home'}, },
    { path: '/businessExecution',meta:{title:'业务执行'}, component:()=> import('@/views/businessExecution/index.vue') },
    { path: '/salesPlanDetail',meta:{title:'销售计划执行明细'}, component:()=> import('@/views/businessExecution/salesPlanDetail.vue') },
    { path: '/purchasingPlanDetail',meta:{title:'采购计划执行明细'}, component:()=> import('@/views/businessExecution/purchasingPlanDetail.vue') },
    { path: '/jobOrderStatistics',meta:{title:'作业单统计'}, component:()=> import('@/views/jobOrderStatistics/jobOrderStatistics.vue') },
    { path: '/register2',meta:{title:'注册-web'}, component:()=> import('@/views/register/index2.vue') },
    { path: '/equipmentScreen',meta:{title:'设备概览大屏'}, component:()=> import('@/views/equipmentScreen/equipmentScreen.vue') },
    { path: '/containerDistribution',meta:{title:'集装箱分布'}, component:()=> import('@/views/containerDistribution/containerDistribution.vue') },
    { path: '/overviewRequest',meta:{title:'请车概览'}, component:()=> import('@/views/overviewRequest/overviewRequest.vue') },
]
// 创建路由实例
const router = new VueRouter({
    mode: 'history',//模式
    routes:routes
});
router.beforeEach((to, from, next) => {
    try {
        document.title = to.meta.title;
    } catch (error) {
        console.error('Failed to set document title:', error);
    }
    next();
});

export default router;